package test;
import com.eclecticdesignstudio.motion.Actuate;
import nme.display.Bitmap;
import nme.events.MouseEvent;

/**
 * ...
 * @author liwei
 */

class TestTween extends TestBase
{
	private var _bm:Bitmap;
	override public function start():Void 
	{
		_bm = new Bitmap();
		addChild(_bm);
		_bm.bitmapData = ApplicationMain.getAsset("img/test.png");
		addEventListener(MouseEvent.MOUSE_DOWN, mousehandler);
		this.graphics.beginFill(0x00ff00, 0.3);
		this.graphics.drawRect(0, 0, 600, 400);
		this.graphics.endFill();
	}
	private function mousehandler(e:MouseEvent):Void {
		Actuate.tween(_bm, 1, { x:this.mouseX-_bm.width*0.5, y:this.mouseY-_bm.height*0.5 } );
	}
	
}